package com.example.myapplication;

import android.media.tv.TvInputService;
import android.net.Uri;
import android.view.Surface;

public class ITvInputService  extends TvInputService {
    private static String TAG = ITvInputService.class.getSimpleName();
    private Surface mSurface;
    private float mVolume;
    private Uri mChannelUri;
    @Override
    public Session onCreateSession(String inputId) {
        Session session = new Session(this) {
            @Override
            public void onRelease() {
                if (mSurface != null) {
                    mSurface.release();
                }
            }

            @Override
            public boolean onSetSurface(Surface surface) {
                mSurface = surface;
                return true;
            }

            @Override
            public void onSetStreamVolume(float volume) {
                mVolume = volume;
            }

            @Override
            public boolean onTune(Uri channelUri) {
                mChannelUri = channelUri;
                return false;
            }

            @Override
            public void onSetCaptionEnabled(boolean enabled) {}
        };
        session.setOverlayViewEnabled(false);
        return  session;
    }
}
